home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d27 / dm310.arc / DM3DIR.MNU < prev    next >
Text File  |  1990-07-22  |  2KB  |  58 lines

  1. Comment
  2. =============================================================
  3.  
  4. DM3DIR.MNU Copyright 1990 by Marc Perkel
  5.  
  6. This example brings up all directories under the current
  7. directory and allows you to change to that directory. This
  8. example was written to work under DM3 but can be run from the
  9. command line by typing MARXMENU DM3DIR.
  10.  
  11. It requires that you have PIPEDIR from the Computer Tyme DOS
  12. ToolBox, or a PIPEDIR type program that can scan your drive and
  13. output complete file names that can be redirected to a temporary
  14. file.
  15.  
  16. =============================================================
  17. EndComment
  18.  
  19. Var ChooseFiles NewPath TmpFile W BoxDim
  20.  
  21. ClearScreenOnExit Off
  22. ClearScreenFirst Off
  23.  
  24. BoxBorderColor Green Brown
  25. BoxInsideColor Yellow Brown
  26. BoxHeaderColor Yellow Mag
  27.  
  28. DrawBox 31,9,17,3
  29. Write ' * Scanning * '
  30.  
  31. ;Run PIPEDIR and redirect the output to a temporary file, then
  32. ;read the output file into a string array and delete the file.
  33.  
  34. TmpFile = UniqueFileName
  35. Execute 'PIPEDIR/T/N/X>' + TmpFile
  36. ReadTextFile TmpFile ChooseFiles
  37. DelFile TmpFile
  38.  
  39. EraseTopWindow
  40.  
  41. if NumberOfElements(ChooseFiles) = 0 then ExitMenu
  42.  
  43. ;------ this calculates the size and position of the pick window.
  44.  
  45. BoxDim[3] = Min(LongestLine + 6,ScreenWidth - 6)
  46. BoxDim[4] = Min(NumberOfElements(ChooseFiles) + 2,ScreenHeight)
  47. BoxDim[1] = Max(Min(50,ScreenWidth - BoxDim[3]),1)
  48. BoxDim[2] = Max(Min(7,ScreenHeight - BoxDim[4]),1)
  49.  
  50. DrawBox BoxDim[1] BoxDim[2] BoxDim[3] BoxDim[4]
  51. NewPath = PickOne ChooseFiles
  52. if NewPath = '' then ExitMenu
  53.  
  54. ;------ Here we remove the file name from the path.
  55.  
  56. ChDir NewPath
  57.  
  58.